import 'package:flutter/material.dart';
import 'package:yurun_smartmerchants/page/add_staff.dart';
import 'package:yurun_smartmerchants/page/approach_administration.dart';
import 'package:yurun_smartmerchants/page/approach_choose_car.dart';
import 'package:yurun_smartmerchants/page/approach_detail.dart';
import 'package:yurun_smartmerchants/page/approach_edit_car.dart';
import 'package:yurun_smartmerchants/page/approach_stall.dart';
import 'package:yurun_smartmerchants/page/custom_add.dart';
import 'package:yurun_smartmerchants/page/custom_administration.dart';
import 'package:yurun_smartmerchants/page/home.dart';
import 'package:yurun_smartmerchants/page/inventory_detail.dart';
import 'package:yurun_smartmerchants/page/inventory_management.dart';
import 'package:yurun_smartmerchants/page/login.dart';
import 'package:yurun_smartmerchants/page/market_pay.dart';
import 'package:yurun_smartmerchants/page/mine.dart';
import 'package:yurun_smartmerchants/page/mine_setup.dart';
import 'package:yurun_smartmerchants/page/mine_setup_service.dart';
import 'package:yurun_smartmerchants/page/modify_staff.dart';
import 'package:yurun_smartmerchants/page/out_ground_apply.dart';
import 'package:yurun_smartmerchants/page/pay_record.dart';
import 'package:yurun_smartmerchants/page/personal_information_improvement.dart';
import 'package:yurun_smartmerchants/page/product_manager_page.dart';
import 'package:yurun_smartmerchants/page/sales_account_page.dart';
import 'package:yurun_smartmerchants/page/staff_detail.dart';
import 'package:yurun_smartmerchants/page/tally_management.dart';
import 'package:yurun_smartmerchants/page/user_protocol.dart';
import 'package:yurun_smartmerchants/page/wait_pay_record.dart';
import 'package:yurun_smartmerchants/page/welcome.dart';
import 'package:yurun_smartmerchants/page/workspace.dart';
import 'package:yurun_smartmerchants/page/enterprise_filing.dart';

const login_page = '/login_page';
const welcome_page = '/welcome_page';
const home_page = '/home_page';
const mine_page = '/mine_page';
const workspace_page = '/workspace_page';
const protocol_page = '/protocol_page';
const mine_setup_page = '/mine_setup_page';
const mine_setup_service_page = '/mine_setup_service_page';
const market_pay_page = '/market_pay_page';
const pay_record_page = '/pay_record_page';
const wait_pay_record_page = '/wait_pay_record_page';
const out_ground_apply_page = '/out_ground_apply_page';
const approach_administration_page = '/approach_administration_page';
const personal_information_page = '/personal_information_improvement';
const approach_stall = '/approach_stall';
const approach_choose_car = '/approach_choose_car';
const approach_edit_car = '/approach_edit_car';
//企业备案
const enterprise_page = 'enterprise_filing';
///理货管理页面
const tally_management_page = '/tally_management';
///理货详情页
const tally_detail_page = '/tally_details_page';
///销售台账
const sales_account_page = '/sales_account_page';
const staff_management_page = '/staff_management_page';
const add_staff_page = '/add_staff_page';
const staff_detail_page = '/staff_detail_page';
const modify_staff_page = '/modify_staff_page';
const inventory_management_page = '/inventory_management_page';
const inventory_detail_page = '/inventory_detail_page';
const custom_administration = '/custom_administration';
const custom_add = '/custom_add';
const product_manage = '/product_manage_page';
const approach_detail = '/approach_detail';


Route<dynamic> onGenerateRoute(RouteSettings settings) {
  String routeName = settings.name;
  print('当前访问路由名:$routeName');
  switch (routeName) {
    case welcome_page:
      return MaterialPageRoute(builder: (context) => WelcomePage());
    case login_page:
      return MaterialPageRoute(builder: (context) => LoginPage());
    case home_page:
      return MaterialPageRoute(builder: (context) => HomePage());
    case workspace_page:
      return MaterialPageRoute(builder: (context) => WorkSpace());
    case mine_page:
      return MaterialPageRoute(builder: (context) => MinePage());
    case protocol_page:
      return MaterialPageRoute(builder: (context) => Protocol());
    case mine_setup_page:
      return MaterialPageRoute(builder: (context) => MineSetup());
    case mine_setup_service_page:
      return MaterialPageRoute(builder: (context) => MineSetupService());
    case market_pay_page:
      return MaterialPageRoute(builder: (context) => MarketPay());
    case pay_record_page:
      return MaterialPageRoute(builder: (context) => PayRecord());
    case wait_pay_record_page:
      return MaterialPageRoute(builder: (context) => WaitPayRecord(name: settings.arguments,));
    case out_ground_apply_page:
      return MaterialPageRoute(builder: (context) => OutGroundApply());
    case approach_administration_page:
      return MaterialPageRoute(builder: (context) => ApproachAdministration());
    case personal_information_page:
      return MaterialPageRoute(builder: (context) => PersonalInformationImprovement(type: settings.arguments));
    case approach_stall:
      return MaterialPageRoute(builder: (context) => ApproachStall());
    case approach_choose_car:
      return MaterialPageRoute(builder: (context) => ApproachChooseCar());
    case approach_edit_car:
      return MaterialPageRoute(builder: (context) => ApproachEditCar(carQueryContent: settings.arguments));
    case enterprise_page:
      return MaterialPageRoute(builder: (context) => Enterprisefiling());
    case tally_management_page:
      return MaterialPageRoute(builder: (context)=> TallyManagement());
    case sales_account_page:
      return MaterialPageRoute(builder: (context)=> SalesAccountPage());
    case add_staff_page:
      return MaterialPageRoute(builder: (context)=> AddStaffPage());
    case staff_detail_page:
      return MaterialPageRoute(builder: (context)=> StaffDetailPage(staff: settings.arguments,));
    case modify_staff_page:
      return MaterialPageRoute(builder: (context)=> ModifyStaffPage(staff: settings.arguments,));
    case custom_administration:
      return MaterialPageRoute(builder: (context)=> CustomAdministration());
    case custom_add:
      return MaterialPageRoute(builder: (context)=> CustomAdd(customListContent: settings.arguments));
    case inventory_management_page:
      return MaterialPageRoute(builder: (context)=> InventoryManagementPage());
    case inventory_detail_page:
      return MaterialPageRoute(builder: (context)=> InventoryDetailPage(goodContent: settings.arguments,));
    case product_manage:
      return MaterialPageRoute(builder: (context)=> ProductManagement());
    case approach_detail:
      return MaterialPageRoute(builder: (context)=> ApproachDetail());
    default:
      return null;
//        return MaterialPageRoute(builder: (context) => Scaffold(body: Center(child: Text("Page not found"),)))
  }
}
